<template>
  <el-select :value="value" placeholder="请选择" @input="change($event)">
    <el-option
      v-for="(item, index) in options[language]"
      :key="index"
      :value="item.value"
      :label="`${item.label}+${item.value}`"
    />
  </el-select>
</template>

<script>
export default {
  // props: ['value', 'language'],
  props: {
    value: {
      type: String,
      default: ''
    },
    language: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      options: {
        cn: [
          { value: '86', label: '中国' },
          { value: '886', label: '中国台湾' },
          { value: '852', label: '中国香港' },
          { value: '60', label: '马来西亚' },
          { value: '65', label: '新加坡' },
          { value: '81', label: '日本' },
          { value: '82', label: '韩国' },
          { value: '1', label: '美国' },
          { value: '1', label: '加拿大' },
          { value: '61', label: '澳大利亚' },
          { value: '64', label: '新西兰' },
          { value: '54', label: '阿根廷' },
          { value: '971', label: '阿联酋' },
          { value: '353', label: '爱尔兰' },
          { value: '20', label: '埃及' },
          { value: '372', label: '爱沙尼亚' },
          { value: '43', label: '奥地利' },
          { value: '853', label: '澳门' },
          { value: '1242', label: '巴哈马' },
          { value: '507', label: '巴拿马' },
          { value: '55', label: '巴西' },
          { value: '375', label: '白俄罗斯' },
          { value: '359', label: '保加利亚' },
          { value: '32', label: '比利时' },
          { value: '48', label: '波兰' },
          { value: '501', label: '伯利兹' },
          { value: '45', label: '丹麦' },
          { value: '49', label: '德国' },
          { value: '7', label: '俄罗斯' },
          { value: '33', label: '法国' },
          { value: '63', label: '菲律宾' },
          { value: '358', label: '芬兰' },
          { value: '57', label: '哥伦比亚' },
          { value: '31', label: '荷兰' },
          { value: '996', label: '吉尔吉斯斯坦' },
          { value: '855', label: '柬埔寨' },
          { value: '974', label: '卡塔尔' },
          { value: '370', label: '立陶宛' },
          { value: '352', label: '卢森堡' },
          { value: '40', label: '罗马尼亚' },
          { value: '976', label: '蒙古' },
          { value: '51', label: '秘鲁' },
          { value: '212', label: '摩洛哥' },
          { value: '52', label: '墨西哥' },
          { value: '27', label: '南非' },
          { value: '234', label: '尼日利亚' },
          { value: '47', label: '挪威' },
          { value: '351', label: '葡萄牙' },
          { value: '46', label: '瑞典' },
          { value: '41', label: '瑞士' },
          { value: '381', label: '塞尔维亚' },
          { value: '248', label: '塞舌尔' },
          { value: '966', label: '沙特阿拉伯' },
          { value: '94', label: '斯里兰卡' },
          { value: '66', label: '泰国' },
          { value: '90', label: '土耳其' },
          { value: '216', label: '突尼斯' },
          { value: '58', label: '委内瑞拉' },
          { value: '380', label: '乌克兰' },
          { value: '34', label: '西班牙' },
          { value: '30', label: '希腊' },
          { value: '36', label: '匈牙利' },
          { value: '39', label: '意大利' },
          { value: '972', label: '以色列' },
          { value: '91', label: '印度' },
          { value: '62', label: '印度尼西亚' },
          { value: '44', label: '英国' },
          { value: '1284', label: '英属维尔京群岛' },
          { value: '962', label: '约旦' },
          { value: '84', label: '越南' },
          { value: '56', label: '智利' }
        ],
        cnt: [
          { value: '86', label: '中國' },
          { value: '886', label: '中國臺灣' },
          { value: '852', label: '中國香港' },
          { value: '60', label: '馬來西亞' },
          { value: '65', label: '新加坡' },
          { value: '81', label: '日本' },
          { value: '82', label: '韓國' },
          { value: '1', label: '美國' },
          { value: '1', label: '加拿大' },
          { value: '61', label: '澳大利亞' },
          { value: '64', label: '新西蘭' },
          { value: '54', label: '阿根廷' },
          { value: '971', label: '阿聯酋' },
          { value: '353', label: '愛爾蘭' },
          { value: '20', label: '埃及' },
          { value: '372', label: '愛沙尼亞' },
          { value: '43', label: '奧地利' },
          { value: '853', label: '澳門' },
          { value: '1242', label: '巴哈馬' },
          { value: '507', label: '巴拿馬' },
          { value: '55', label: '巴西' },
          { value: '375', label: '白俄羅斯' },
          { value: '359', label: '保加利亞' },
          { value: '32', label: '比利時' },
          { value: '48', label: '波蘭' },
          { value: '501', label: '伯利茲' },
          { value: '45', label: '丹麥' },
          { value: '49', label: '德國' },
          { value: '7', label: '俄羅斯' },
          { value: '33', label: '法國' },
          { value: '63', label: '菲律賓' },
          { value: '358', label: '芬蘭' },
          { value: '57', label: '哥倫比亞' },
          { value: '31', label: '荷蘭' },
          { value: '996', label: '吉爾吉斯斯坦' },
          { value: '855', label: '柬埔寨' },
          { value: '974', label: '卡塔爾' },
          { value: '370', label: '立陶宛' },
          { value: '352', label: '盧森堡' },
          { value: '40', label: '羅馬尼亞' },
          { value: '976', label: '蒙古' },
          { value: '51', label: '秘魯' },
          { value: '212', label: '摩洛哥' },
          { value: '52', label: '墨西哥' },
          { value: '27', label: '南非' },
          { value: '234', label: '尼日利亞' },
          { value: '47', label: '挪威' },
          { value: '351', label: '葡萄牙' },
          { value: '46', label: '瑞典' },
          { value: '41', label: '瑞士' },
          { value: '381', label: '塞爾維亞' },
          { value: '248', label: '塞舌爾' },
          { value: '966', label: '沙特阿拉伯' },
          { value: '94', label: '斯裏蘭卡' },
          { value: '66', label: '泰國' },
          { value: '90', label: '土耳其' },
          { value: '216', label: '突尼斯' },
          { value: '58', label: '委內瑞拉' },
          { value: '380', label: '烏克蘭' },
          { value: '34', label: '西班牙' },
          { value: '30', label: '希臘' },
          { value: '36', label: '匈牙利' },
          { value: '39', label: '意大利' },
          { value: '972', label: '以色列' },
          { value: '91', label: '印度' },
          { value: '62', label: '印度尼西亞' },
          { value: '44', label: '英國' },
          { value: '1284', label: '英屬維爾京群島' },
          { value: '962', label: '約旦' },
          { value: '84', label: '越南' },
          { value: '56', label: '智利' }
        ],
        en: [
          { value: '86', label: 'China' },
          { value: '886', label: 'China Taiwan' },
          { value: '852', label: 'China Hong Kong' },
          { value: '60', label: 'Malaysia' },
          { value: '65', label: 'Singapore' },
          { value: '81', label: 'Japan' },
          { value: '82', label: 'Korea' },
          { value: '1', label: 'US' },
          { value: '1', label: 'Canada' },
          { value: '61', label: 'Australia' },
          { value: '64', label: 'New Zealand' },
          { value: '54', label: 'Argentina' },
          { value: '971', label: 'UAE' },
          { value: '353', label: 'Ireland' },
          { value: '20', label: 'Egypt' },
          { value: '372', label: 'Estonia' },
          { value: '43', label: 'Austria' },
          { value: '853', label: 'Macau' },
          { value: '1242', label: 'Bahamas' },
          { value: '507', label: 'Panama' },
          { value: '55', label: 'Brazil' },
          { value: '375', label: 'Belarus' },
          { value: '359', label: 'Bulgaria' },
          { value: '32', label: 'Belgium' },
          { value: '48', label: 'Poland' },
          { value: '501', label: 'Belize' },
          { value: '45', label: 'Denmark' },
          { value: '49', label: 'Germany' },
          { value: '7', label: 'Russia' },
          { value: '33', label: 'France' },
          { value: '63', label: 'Philippines' },
          { value: '358', label: 'Finland' },
          { value: '57', label: 'Colombia' },
          { value: '31', label: 'Netherlands' },
          { value: '996', label: 'Kyrgyzstan' },
          { value: '855', label: 'Cambodia' },
          { value: '974', label: 'Qatar' },
          { value: '370', label: 'Lithuania' },
          { value: '352', label: 'Luxembourg' },
          { value: '40', label: 'Romania' },
          { value: '976', label: 'Mongolia' },
          { value: '51', label: 'Peru' },
          { value: '212', label: 'Morocco' },
          { value: '52', label: 'Mexico' },
          { value: '27', label: 'South Africa' },
          { value: '234', label: 'Nigeria' },
          { value: '47', label: 'Norway' },
          { value: '351', label: 'Portugal' },
          { value: '46', label: 'Sweden' },
          { value: '41', label: 'Switzerland' },
          { value: '381', label: 'Serbia' },
          { value: '248', label: 'Seychelles' },
          { value: '966', label: 'Saudi Arabia' },
          { value: '94', label: 'Sri Lanka' },
          { value: '66', label: 'Thailand' },
          { value: '90', label: 'Turkey' },
          { value: '216', label: 'Tunisia' },
          { value: '58', label: 'Venezuela' },
          { value: '380', label: 'Ukraine' },
          { value: '34', label: 'Spain' },
          { value: '30', label: 'Greece' },
          { value: '36', label: 'Hungary' },
          { value: '39', label: 'Italy' },
          { value: '972', label: 'Israel' },
          { value: '91', label: 'India' },
          { value: '62', label: 'Indonesia' },
          { value: '44', label: 'UK' },
          { value: '1284', label: 'British virgin islands' },
          { value: '962', label: 'Jordan' },
          { value: '84', label: 'Vietnam' },
          { value: '56', label: 'Chile' }
        ]
      }
    }
  },
  // computed: {
  //   countryCode: {
  //     get() {
  //       return this.value
  //     },
  //     set(newValue) {
  //       this.$emit('input', newValue)
  //     }
  //   }
  // },
  methods: {
    change(val) {
      this.$emit('input', val)
    }
  }
}
</script>
